home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 015a / qw12inst.zip / BUS-MAST.TEC < prev    next >
Text File  |  1991-03-11  |  6KB  |  118 lines

  1. ID:BU Bus-Mastering Devices and QEMM-386
  2. Quarterdeck Technical Note #121
  3. by Stan Young
  4.  
  5.  
  6.     Bus-Mastering Devices, QEMM-386 and Virtual DMA Services
  7.  
  8. Q: What is a bus-mastering device and what problems might be seen 
  9.    when using one?
  10.  
  11. Bus-mastering devices are ones which do their own direct memory
  12. addressing (DMA).  DMA is done without going through the machine's
  13. processor.  The most common bus-mastering devices we see currently
  14. are SCSI hard disk controllers, but technically, other types of
  15. devices could be bus-mastering as well.  The problem seen with
  16. bus-mastering devices is that while they are high-performance
  17. devices and quite often found on 386 and 486 machines, they are
  18. unfortunately, in their design, incompatible with one of the
  19. operating modes of the 80386 and i486 processors -- the Virtual 86
  20. mode.
  21.  
  22. Specifically, the problem is that the device puts data into
  23. absolute memory addresses and assumes that the contents of those 
  24. memory addresses will always remain constant.  However, on a 386 
  25. machine with the processor in Virtual 86 mode, this can often be 
  26. an incorrect assumption.  In Virtual 86 mode, the same physical
  27. memory addresses can, at any given moment hold different data,
  28. depending on which virtual machine is current.
  29.  
  30. If you are using a bus-mastering device on a 386 or 486 that is in
  31. Virtual 86 mode and actual memory paging is occurring (the
  32. switching from one virtual machine to another), your machine will
  33. probably hang when you use the bus-mastering device.
  34.  
  35. A "real world" example:  
  36.  
  37. Quarterdeck first became aware of the problem from customers who
  38. had bus-mastering SCSI hard disk controllers.  They reported that 
  39. they could boot their machines, start our multitasking DESQview
  40. software and as long as they ran only one application, their system
  41. ran fine.  As soon as they opened a second application, the system
  42. would hang.  The problem was also seen by users who were not using
  43. DESQview, but who were using the LOADHI feature of QEMM-386.
  44.  
  45. In this case, the hang occurred because the disk controller would 
  46. prepare to load some absolute memory addresses with data pertaining
  47. to an application that was running, but by the time the data was
  48. actually transferred to these addresses, QEMM-386 had switched the
  49. memory map.  Those absolute memory addresses no longer belonged to
  50. the application which could process the data.  They belonged
  51. instead to some other application or process.  In theory, this
  52. could have caused data corruption, but in reality it never did. 
  53. The memory corruption was typically so extensive that the systems
  54. simply hung as soon as a change in the memory map occurred.
  55. Q: How can the problem with running Bus-mastering devices in 
  56.    Virtual 86 mode be corrected?
  57.  
  58. A: There are four possible solutions:
  59.  
  60. 1) QEMM 5.00 (and later versions) has a DB=xx (DISKBUF=xx)
  61. parameter which should prevent QEMM-SCSI problems at the expense 
  62. of a little conventional memory.  xx is the number of K used for 
  63. buffering.  Any value for xx is sufficient to correct the problem. 
  64. DISKBUF=2 would be fine for most cases. Higher numbers, say up to
  65. 10 might improve performance.  Setting DISKBUF to more than 10 is
  66. probably a waste of memory.
  67.  
  68. This approach will not work in cases where the bus-mastering 
  69. device is something other than a hard disk.
  70.  
  71. 2) Similarly, the drivers of many bus-mastering hard disks have
  72. buffering options.  Check the documentation for your disk         
  73. controller to see if the driver has a parameter to set up buffering
  74. for disk operations.  Some drivers will also document parameters
  75. that are specific to 386 operations.  For example, the early
  76. Adaptec drivers SCSIHA.SYS and AHA1540.SYS included both 386 and
  77. disk buffering options invoked by the parameters "/v386" and
  78. "/b:64."  "/v386" stands for virtual 386; "/b:64" allocates a 64k
  79. buffer, for DMA.  
  80.  
  81. 3) Check the documentation for your bus-mastering device and see 
  82. if it can be configured to use the BIOS or any one of the standard
  83. DMA channels.  QEMM can correct the problem if the BIOS or standard
  84. DMA channels are used.
  85.  
  86. 4) THE BEST SOLUTION:  Contact the maker of your bus-mastering
  87. device and see if they have a driver available which supports the 
  88. VDS (Virtual DMA Services) specification.  VDS is now an
  89. industry-wide specification supported by IBM, Microsoft and
  90. Quarterdeck, as well as many other hardware and software suppliers.
  91.  
  92. A VDS driver allows a bus-mastering device to find the real
  93. physical address of its data when the processor is in Virtual 86
  94. mode.
  95.  
  96. QEMM 5.00 (and later versions) supports the VDS specification.
  97. A VDS driver provides the best solution to this problem in terms of
  98. reliability, speed and memory efficiency.  
  99.  
  100. Q:  I know I have a bus-mastering device on my computer, but I 
  101.     haven't seen any problem.  Why not?
  102.  
  103. A:  It's possible that your bus-mastering device uses a standard 
  104.     DMA channel for DMA operations.  QEMM-386 can correct the     
  105.     problem when standard DMA channels are used.  
  106.  
  107. Also, it is quite possible that your bus-mastering device was
  108. shipped with a VDS driver.  Bus-mastering hard disk controllers are
  109. starting to ship with drivers that make VDS calls, and these
  110. drivers do not require the DB parameter or any other buffering.  We
  111. expect that most bus-mastering devices will eventually include VDS
  112. drivers and therefore will not exhibit any problems when run in
  113. Virtual 86 mode.
  114.  
  115.         Copyright (C) 1991 by Quarterdeck Office Systems
  116.              * * *   E N D   O F   F I L E    * * * 
  117.  
  118.